package com.galeno.test;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author galeno
 * @Title:
 * @Description:
 * @date 日期2021/11/14时间10:13
 */
public class PattenDemo {
    public static void main(String[] args) {
        String events="ABDFCDBB";
        //判断B出现的次数
        String patten="(.*?B)";
        Pattern compile = Pattern.compile(patten);

        Matcher matcher = compile.matcher(events);
        int count=0;
        while (matcher.find()){
            System.out.println(++count);
        }

        //判断AB行为序列次数


    }
}
